const app = getApp();
const rq = require('../../utils/https.js');
Page({
  data: {
    PageCur: 'basics'
  },
  onLoad() {
    wx.setStorageSync('user_id', 2)
    wx.setStorageSync('user_name', '美羊羊')
    //获取用户信息
    rq.request('meeting/users', {}, function(result) {
      if (result.code == 0) {
        let users = result.data;
        wx.setStorageSync('users', users)
      } else {
        wx.showToast({
          title: '用户信息请求失败',
        })
      }
    })
    //获取会议室信息
    rq.request('meeting/rooms', {}, function(result) {
      if (result.code == 0) {
        wx.setStorageSync('rooms', result.data)
      } else {
        wx.showToast({
          title: '会议室信息加载失败',
        })
      }
    })
  },
  onShow() {
    console.log(this.selectAllComponents('#about'));
  },
  NavChange(e) {
    this.setData({
      PageCur: e.currentTarget.dataset.cur
    })
  },
  onShareAppMessage() {
    return {
      title: 'ColorUI-高颜值的小程序UI组件库',
      imageUrl: '/images/share.jpg',
      path: '/pages/index/index'
    }
  },
})